<!-- 会诊详情 -->
<template>
  <ToolbarItemContainer
    :iconFile="Icon"
    title="会诊详情"
    :needBottomPopup="true"
    :iconWidth="isUniFrameWork ? '26px' : '20px'"
    :iconHeight="isUniFrameWork ? '26px' : '20px'"
    :needDialog="false"
    @onIconClick="onIconClick"
    ref="container"
  />
</template>
<script setup lang="ts">
import { TUIStore, StoreName, IConversationModel } from '@tencentcloud/chat-uikit-engine'
import { ref } from '@/TUIKit/adapter-vue'
import ToolbarItemContainer from '@/TUIKit/components/TUIChat/message-input-toolbar/toolbar-item-container/index.vue'
import { isEnabledMessageReadReceiptGlobal } from '@/TUIKit/components/TUIChat/utils/utils'
import { isPC, isUniFrameWork } from '@/TUIKit/utils/env'
import Icon from '@/TUIWidget/static/icon/consultation.png'

import { SendGroupMessage } from '@/utils/TIM'

const currentConversation = ref<IConversationModel>()
const container = ref()

TUIStore.watch(StoreName.CONV, {
  currentConversation: (conversation: IConversationModel) => {
    currentConversation.value = conversation
  },
})

/** 点击事件 */
const onIconClick = () => {
  console.log('-- 会诊详情 ---------------->')

  const message = {
    businessID: 'tip',
    // type: 'highlight', // default | highlight | card | topbar |
    text: '我是个 default tip, 我比较低调',
  }
  const message1 = {
    businessID: 'tip',
    type: 'highlight',
    text: '我是个 highlight tip, 我是最帅的',
  }
  const message2 = {
    businessID: 'tip',
    type: 'card',
    title: '会诊服务',
    text: '医生已为您推荐了会诊服务的医生，点击即可缴费会诊服务的医生，会诊服务的医生，会诊服务的.......',
    buttonText: '去查看',
    buttonUrl: '/pages/ConsultationRoom/Prescription/Prescription',
  }
  const message3 = {
    businessID: 'tip',
    type: 'topbar',
    text: '我是个 topbar tip, 我是站在巨人的肩膀上！',
  }

  // 发送群消息
  // SendGroupMessage('@TGS#1JMBMMSOU', message3)

  // uni.navigateTo({
  //   url: `/pages/ConsultationRoom/Prescription/Prescription`,
  // })
}
</script>
<style scoped lang="scss" src="./style/index.scss"></style>
